#!/bin/bash

##docker network create --driver bridge --subnet 172.18.0.0/24 --gateway 172.18.0.1 mynet

docker pull nginx

docker run -itd --name nginx -p 80:80 nginx

docker exec -it nginx cat /usr/share/nginx/html/index.html

docker cp /etc/nginx/conf.d/nginx.conf /opt/docker/nginx/nginx.conf

docker run -itd --name nginx -p 80:80 -p 11660:11660 -v /opt/docker/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf nginx



#docker pull nginx:1.23.0

##主
#docker run -itd --name nginx1 -p 8080:80 nginx:1.23.0
#
#docker run -itd --name nginx2 nginx:1.23.0
#
#docker run -itd --name nginx3 nginx:1.23.0
#
#
#docker exec -it nginx1 apt update
#
#docker exec -it nginx1 apt install vim
#
#
#docker commit -a "yuninglong" -m "nginx with vim" nginx1  nginx_yuninglong:v1

docker pull registry.cn-shenzhen.aliyuncs.com/nmrbt/nginx

docker run -itd --name nginx1 -p 8080:80 registry.cn-shenzhen.aliyuncs.com/nmrbt/nginx
docker run -itd --name nginx2 -p 8081:80 registry.cn-shenzhen.aliyuncs.com/nmrbt/nginx
docker run -itd --name nginx3 -p 8082:80 registry.cn-shenzhen.aliyuncs.com/nmrbt/nginx
##docker exec -it nginx1 vim

##修改 标题内容
docker exec -it nginx1 vim  /usr/share/nginx/html/index.html
docker exec -it nginx2 vim  /usr/share/nginx/html/index.html
docker exec -it nginx3 vim  /usr/share/nginx/html/index.html



docker network ls
docker network inspect bridge

docker exec -it nginx1 vim /etc/nginx/conf.d/default.conf
##docker cp /etc/nginx/conf.d/default.conf /opt/
##
##upstream myserver {
  #
  #        server 172.17.0.4:80;
  #        server 172.17.0.3:80;
  #        server 172.17.0.2:80;
  #}
  #
  #server {
     #    listen       80;
     #    listen  [::]:80;
     #    server_name  localhost;
     #
     #    #access_log  /var/log/nginx/host.access.log  main;
     #
     #    location / {
     #        root   /usr/share/nginx/html;
     #        index  index.html index.htm;
     #        proxy_pass http://myserver;
     #    }
     #}


docker exec -it nginx1 service nginx restart
docker restart nginx1


#./sbin/nginx -s reload




curl 172.17.0.3:80